﻿using System;
using Freshbooks.Model;
using Freshbooks.Properties;
using RestSharp;

namespace Freshbooks
{
    public class CategoryService
    {
        private readonly FreshbooksApi _client;

        protected internal CategoryService(FreshbooksApi client)
        {
            _client = client;
        }

        public int CreateCategory(Category category)
        {
            throw new NotImplementedException();
        }

        public bool DeleteCategory(int categoryId)
        {
            throw new NotImplementedException();
        }

        public Category GetCategory(int categoryId)
        {
            throw new NotImplementedException();
        }

        public Categories GetCategories()
        {
            var request = _client.GetRequest();

            request.RootElement = "categories";

            request.AddParameter("text/xml",
                                 Resources.category_list,
                                 ParameterType.RequestBody);

            return _client.Execute<Categories>(request);
        }

        public bool UpdateCategory(Category category)
        {
            throw new NotImplementedException();
        }
    }
}
